<?php
/**
 * Created by PhpStorm.
 * User: deng
 * Date: 2015/2/27
 * Time: 0:25
 */

namespace Test\Controller;

use \MongoClient;

require_once('Application/Common/Model/DB.php'); //引入DB.php

class PaoController extends \Think\Controller
{
    public function model()
    {

        //获取一个db, 作为一切操作的入口
        $db = \DB::build('Application/Common/Model/models/', (new MongoClient())->metalab);

        //创建一个user模块
        $userId = $db->users->create();

//更新info
        $db->users->info->update($userId, [
            'name' => 'xiaoming',
            'portrait' => 'xxx'
        ]);
        var_dump($db->users->findBy(['skip'=>0, 'limit'=>1]));
    }
}